Skip to content

fix(i18n): format compare sparkline data labels#2537

Merged
graphieros merged 3 commits intomainfrom
compare-sparkline-data-label-format
Apr 15, 2026
Merged

fix(i18n): format compare sparkline data labels#2537
graphieros merged 3 commits intomainfrom
compare-sparkline-data-label-format

Conversation

@graphieros
Copy link
Copy Markdown
Contributor

@graphieros graphieros commented Apr 15, 2026

Follow up to #2519

I was too distracted, and forgot to fix the sparklines in the compare page.
Also rounds values in the sparkline of the package page (fractional values may happen if data correction is applied)

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Apr 15, 2026 9:39am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Apr 15, 2026 9:39am
npmx-lunaria Ignored Ignored Apr 15, 2026 9:39am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

📝 Walkthrough

Walkthrough

Replaced implicit/default data-label formatting with a locale-aware useNumberFormatter({ maximumFractionDigits: 0 }) and applied it as style.dataLabel.formatter in sparkline components to render values with zero fractional digits.

Changes

Cohort / File(s) Summary
Sparkline data label formatting
app/components/Chart/SplitSparkline.vue, app/components/Package/WeeklyDownloadStats.vue
Both components now instantiate useNumberFormatter({ maximumFractionDigits: 0 }) and set style.dataLabel.formatter to ({ value }) => numberFormatter.value.format(value), changing data-label output to locale-aware whole numbers.

Possibly related PRs

Suggested reviewers

  • 43081j
  • alexdln
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: formatting compare sparkline data labels with i18n support, which directly matches the modifications applied to the sparkline components.
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining it as a follow-up to fix sparkline formatting on the compare page and package page.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch compare-sparkline-data-label-format

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@graphieros graphieros marked this pull request as draft April 15, 2026 09:27
@graphieros graphieros requested review from a team and removed request for a team April 15, 2026 09:43
@graphieros graphieros added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 5fc9e99 Apr 15, 2026
26 checks passed
@graphieros graphieros deleted the compare-sparkline-data-label-format branch April 15, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants